<?php
/*******************************************************************************
 * $Date:: 29 May 2010 00:11:56												   $
 * $Revision::																   $
 * $Author:: Tuan Duong													   	   $
 * $Comment::															   	   $
 ******************************************************************************/

class Admin_UserController extends Bet_Admin_Controller
{
	public function init()
	{
		/* Initialize action controller here */
		parent::init();
	}

	public function indexAction() {

	}

	public function addAction()	{
		$addUserForm = new Bet_Form_User_Add();
		if ($this->getRequest()->isPost()) {
			if ($addUserForm->isValid($_POST)) {
				$user = new Bet_Model_User($addUserForm->getValues());
				$user->setStatus(Bet_Model_User::STATUS_ENABLE);

				$mapper = new Bet_Model_UserMapper();
				$mapper->save($user);
			}
		}

		$this->view->form = $addUserForm;
	}
}